pub type Result<T> = core::result::Result<T, Error>;

#[allow(unused)]
#[derive(Debug, PartialEq)]
pub enum Error {
    FileNotFound(String),
    ParseError(String),
    IoError(String),
    LexicalError {
        message: String,
        line: usize,
    },
}

impl core::fmt::Display for Error {
    fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::result::Result<(), core::fmt::Error> {
        write!(fmt, "{self:?}")
    }
}


impl std::error::Error for Error {}

impl From<std::io::Error> for Error {
    fn from(value: std::io::Error) -> Self {
        Self::IoError(value.to_string())
    }
}